package com.shunwang.errors.errorinfo;

public class ErrorLogger {

	private ThreadLocal<ErrorInfo> info = new ThreadLocal<ErrorInfo>();
	
	private final static ErrorLogger instance = new ErrorLogger();
	public ErrorInfo getInfo(){
		ErrorInfo infoEx = info.get();
		if(infoEx == null){
			infoEx = new ErrorInfo();
			info.set(infoEx);
		}
		return infoEx;
	}
	
	public void removeInfo(){
		info.set(null);
	}
	
	private ErrorLogger(){
		
	}
	
	public static ErrorLogger getInstance(){
		return instance;
	}
}
